package com.u.tool;

import java.util.List;

import com.u.eventInfo.EventLog;

public class EventLogUtil {

	public static List<EventLog> GetLogList(String event_id){
		List<EventLog> list;
		String sql = "SELECT * FROM y_r.eventlog where event_id='"+ event_id 
				+"' order by date desc";
		MysqlUtil db = new MysqlUtil();
		db.connection();
		list = db.query(EventLog.class, sql);
		return list;	
	}
	
	public static void AddLog(EventLog eventLog) {
		MysqlUtil db = new MysqlUtil();
		db.connection();
		db.add(eventLog);
	}
	
	public static void main(String[] args) {
		List lis = GetLogList("001");
		EventLog eventLog = (EventLog) lis.get(0);
		try{
			eventLog.getPic_addr().length();
		}catch(NullPointerException e) {
			eventLog.setPic_addr("0");
		}
		
	}
}
